-
-
Notifications
You must be signed in to change notification settings - Fork 26
Refactoring auth module and tests #357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
516de10 to
09d0287
Compare
69034ba to
80e249a
Compare
1d21e48 to
9515813
Compare
josvandervelde
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Omosola! Some nice improvements. There are some problems that don't surface when using the unittests - let me know if I can be of any help.
server/user/views.py
Outdated
| session.commit() | ||
| return jsonify({ | ||
| "msg": "API Key updated", | ||
| "apikey": user.session_hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for other reviewers: adding the apikey here makes sure that the frontend can show the new api-key to the user.
|
|
||
| ctx.pop() | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but the current tests seem to assume that the user sets the environment variable DO_SEND_MAIL=False.
Adding this code fixes that issue:
from server.public import views
@pytest.fixture(scope="session", autouse=True)
def set_env():
with patch.object(views, "DO_SEND_EMAIL", False) as _fixture:
yield _fixture|
Thanks for the review @josvandervelde! A couple of changes are related to previous implementation decisions that I left alone for this PR since I wasn't sure about the reasons behind some of those choices. I didn't want to touch too much existing decision logic in this PR. My main focus for this PR was getting the user test suite running cleanly and finishing up unfinished implementations discovered through those updated tests (and aligning them with the old app's functionality). All good comments/points, though! I'll make those changes, but I might put some of them in a separate PR. |
…res more for test_reset_password
…efactor of Signup module
… password) across backend and frontend
9515813 to
903b94d
Compare
Opening for discussion
Refactoring of (and some fixes in) the auth module, including tests.
Expanding test suite to cover more cases, and correcting existing tests.
Now with clean test suite runs. ✅
Added notes along the PR for main areas to focus on.